<#-- @ftlvariable name="entity" type="com.xci.edu.core.entity.EduStudentPeriodSummary" -->
<#include "/sys/_layout.ftl">
<#assign allowInsert=sysWeb.auth("background.eduStudentPeriodSummary.insert")/>
<#assign allowUpdate=sysWeb.auth("background.eduStudentPeriodSummary.update")/>
<#assign allowDelete=sysWeb.auth("background.eduStudentPeriodSummary.delete")/>
<#assign allowExport=sysWeb.auth("background.eduStudentPeriodSummary.export")/>
<!doctype html>
<html>
<head>
    <@pageHeader/>
</head>
<body>
<@pageLoading/>
<div id="gridtoolbar">
    <form id="gridform" class="jxlayout-form form-inline jxform">
        <div class="form-group">
            <input name="key" class="form-control w-250px" placeholder="请输入查询关键字" autocomplete="off">
        </div>
        <div class="form-group">
            <select name="status" class="jxselect form-control" data-select-submit="true" data-allow-clear="false" data-width="110">
                ${web.statusSelectOptions()}
            </select>
        </div>
        <button class="btn btn-primary ml-5" type="submit">
            <i class="fa fa-search"></i> 查询
        </button>
        <div class="btn-group">
            <@echo test=allowInsert>
                <a class="btn btn-default" onclick="curd.createData()">
                    <i class="icon-plus"></i> 新建
                </a>
            </@echo>
            <@echo test=allowUpdate>
                <a class="btn btn-default" onclick="curd.editData()">
                    <i class="icon-pencil"></i> 编辑
                </a>
            </@echo>
            <@echo test=allowDelete>
                <a class="btn btn-default" onclick="curd.deleteData()">
                    <i class="icon-trash"></i> 删除
                </a>
            </@echo>
            <@echo test=allowExport>
                <a class="btn btn-default" onclick="curd.exportData()">
                    <i class="icon-share-alt"></i> 导出
                </a>
            </@echo>
        </div>
    </form>
</div>
<table id="grid" data-options="form:'#gridform',toolbar:'#gridtoolbar'">
    <thead>
    <tr>
        <th data-options="field:'ck',checkbox:true"></th>
        <th data-options="title:'学员主键',field:'studentId',width:200,align:'left',sortable: false"></th>
        <th data-options="title:'课件主键',field:'coursewareId',width:200,align:'left',sortable: false"></th>
        <th data-options="title:'学时(秒)',field:'period',width:200,align:'left',sortable: false"></th>
    </tr>
    </thead>
</table>
<@pageFooter/>
<script>
    jx.ready(function () {
        window.curd = new jx.GridCurd('#grid', {
            title: '学员学时汇总',
            dialogWidth: '600px',
            dialogHeight: '400px',
            api: {
                grid: '/background/eduStudentPeriodSummary/grid',
                create: '/background/eduStudentPeriodSummary/create',
                edit: '/background/eduStudentPeriodSummary/edit',
                delete: '/background/eduStudentPeriodSummary/delete',
                details: '/background/eduStudentPeriodSummary/details',
                status: '/background/eduStudentPeriodSummary/status',
                export: '/background/eduStudentPeriodSummary/export'
            },
            onInit: function (instance) {
                //状态事件
                instance.gridPanel.on('click', '.gridstatus', function () {
                    instance.setStatusDataById($(this).data('id'), $(this).data('val') == '1' ? 0 : 1);
                });
            }
        });
    });
</script>
</body>
</html>
